Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/AlertHost.kt 520fa717a938fd84682403b41f57d9f7e1ef49ef (520fa717) Text, 2.13 KB

T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.component

Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787org.meshtastic.core.ui.util.AlertManager

T8b949e/**
* Shared composable that observes [AlertManager.currentAlert] and renders a [MeshtasticDialog] when an alert is
* present. This eliminates duplicated alert-rendering boilerplate across Android and Desktop host shells.
*
* Usage: Place `AlertHost(alertManager)` once in the top-level composable of each platform host.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffAlertHostTb4b4b4(Te6edf3alertManagerTb4b4b4: Te6edf3AlertManagerTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3alertDialogState Tff7b72by Te6edf3alertManagerTb4b4b4.Te6edf3currentAlertTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Te6edf3alertDialogStateTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3state Tff7b72-Tff7b72>
Te6edf3MeshtasticDialogTb4b4b4(
Te6edf3title Tff7b72= Te6edf3stateTb4b4b4.Te6edf3titleTb4b4b4,
Te6edf3titleRes Tff7b72= Te6edf3stateTb4b4b4.Te6edf3titleResTb4b4b4,
Te6edf3message Tff7b72= Te6edf3stateTb4b4b4.Te6edf3messageTb4b4b4,
Te6edf3messageRes Tff7b72= Te6edf3stateTb4b4b4.Te6edf3messageResTb4b4b4,
Te6edf3html Tff7b72= Te6edf3stateTb4b4b4.Te6edf3htmlTb4b4b4,
Te6edf3icon Tff7b72= Te6edf3stateTb4b4b4.Te6edf3iconTb4b4b4,
Te6edf3text Tff7b72= Te6edf3stateTb4b4b4.Te6edf3composableMessageTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3msg Tff7b72-Tff7b72> Tb4b4b4{ Te6edf3msgTb4b4b4.Te6edf3ContentTb4b4b4(Tb4b4b4) Tb4b4b4} Tb4b4b4}Tb4b4b4,
Te6edf3confirmText Tff7b72= Te6edf3stateTb4b4b4.Te6edf3confirmTextTb4b4b4,
Te6edf3confirmTextRes Tff7b72= Te6edf3stateTb4b4b4.Te6edf3confirmTextResTb4b4b4,
Te6edf3onConfirm Tff7b72= Te6edf3stateTb4b4b4.Te6edf3onConfirmTb4b4b4,
Te6edf3dismissText Tff7b72= Te6edf3stateTb4b4b4.Te6edf3dismissTextTb4b4b4,
Te6edf3dismissTextRes Tff7b72= Te6edf3stateTb4b4b4.Te6edf3dismissTextResTb4b4b4,
Te6edf3onDismiss Tff7b72= Te6edf3stateTb4b4b4.Te6edf3onDismissTb4b4b4,
Te6edf3choices Tff7b72= Te6edf3stateTb4b4b4.Te6edf3choicesTb4b4b4,
Te6edf3dismissable Tff7b72= Te6edf3stateTb4b4b4.Te6edf3dismissableTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s